package com.china08.yxyapi.entity.db.res;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;

import com.china08.yxyapi.entity.BaseEntity;

/**
 * 资源表
 * 
 * @author Json
 *
 */
@Entity
@Table(name = "yxy_res_resource", catalog = "yxy_res", indexes = { @Index(columnList = "md5") })
public class YxyResResource extends BaseEntity {

	private static final long serialVersionUID = 1L;

	@Column(length = 32)
	private String shoolId;

	@Column(length = 255)
	private String schoolName;

	// 资源作者
	@Column(length = 255)
	private String author;

	// 上传者
	@Column(length = 32)
	private String uploaderId;

	// 上传人名
	@Column(length = 255)
	private String uploaderName;

	// 上传者学校id
	@Column(length = 32)
	private String uploaderSchoolId;

	// 上传者学校明天
	@Column(length = 255)
	private String uploaderSchoolName;

	// 资源简介
	@Column(length = 255)
	private String intro;

	// 标题
	@Column(length = 500, nullable = false)
	private String title;

	// 文件大小
	@Column
	private Integer fileSize = 0;

	// 文件扩展名
	@Column(length = 12)
	private String extension;

	@Column(length = 32, nullable = false)
	private String md5;

	// 下载量
	@Column
	private Long downloadCount = 0l;

	/**
	 * 展示次数
	 */
	@Column
	private Long pv = 0l;

	/**
	 * 备授课采纳次数
	 */
	@Column
	private Long count1 = 0l;

	/**
	 * 备授课采纳次数
	 */
	@Column
	private Long count2 = 0l;
	/**
	 * 预留统计
	 */
	@Column
	private Long count3 = 0l;
	/**
	 * 预留统计
	 */
	@Column
	private Long count4 = 0l;
	/**
	 * 预留统计
	 */
	@Column
	private Long count5 = 0l;
	/**
	 * 收藏次数
	 */
	@Column
	private Long favoriteCount = 0l;

	/**
	 * 是否删除标记，增加此标记，是因为标记为删除之后，可以进行删除撤销，回到上次状态<br>
	 * 0:没有删除 1： 已删除 -1(只传可视频 没有传其他相关内容)
	 */
	@Column(nullable = false)
	private Integer isDelete = 0;

	// 审核状态 0：待审核 1：已通过 2：未通过 3：已下架
	@Column
	private Integer status = 0;

	// 文件的状态信息 0初始上传， 1 转码中 ，2 转码成功 ，3 转码失败
	@Column
	private Integer convertStatus = 0;

	/**
	 * 审核人id
	 */
	@Column
	private String auditUserId;

	/**
	 * 审核人名称
	 */
	@Column
	private String auditUserName;

	/**
	 * 审核人学校id，如果为教育局为教育局id
	 */
	@Column(columnDefinition = " COMMENT '审核人学校id，如果为教育局为教育局id'")
	private String auditSchoolId;

	// 审核人所在学校名称，如果是教育局为教育局名称
	@Column(name = "audit_school_name", columnDefinition = " COMMENT '审核人所在学校名称，如果是教育局为教育局名称'")
	private String auditSchoolName;

	/**
	 * 查看范围 0：私有 1：学校 2： 教育云
	 */
	@Column(nullable = false)
	private Integer viewScope = 0;

	/**
	 * 是否云校显示 1：在云校显示， 0： 不在云校显示
	 */
	@Column(nullable = false)
	private Integer isYxView = 0;

	/**
	 * 文件路径
	 */
	@Column(nullable = false)
	private String location;

	// 0: 非云校资源 1 云校资源
	@Column
	private Integer isYxYunRes = 1;

	/**
	 * 资源所属 ：省代码
	 */
	@Column
	private String provinceCode;
	/**
	 * 资源所属 ：市代码
	 */
	@Column
	private String cityCode;

	/**
	 * 资源所属 ：地区代码
	 */
	@Column
	private String districtCode;

	// 评分
	@Column
	private float mark = 0f;

	// 上传时间
	@Column
	private Date uploadTime = new Date();

	@Column(length = 32, nullable = false)
	private String subjectId = "";

	@Column(length = 255, nullable = false)
	private String subjectName = "";

	@Column(length = 32, nullable = false)
	private String versionId = "";

	@Column(length = 255, nullable = false)
	private String versionName = "";

	/**
	 * 学段id
	 */
	@Column(length = 32, nullable = false)
	private String phaseId = "";

	/**
	 * 学段名称
	 */
	@Column(length = 255, nullable = false)
	private String phaseName = "";

	/**
	 * 学期id
	 */
	@Column(length = 32, nullable = false)
	private String semesterId = "";

	/**
	 * 学期名称，一年级上册，必修，选修
	 */
	@Column(length = 255, nullable = false)
	private String semesterName = "";

	/**
	 * 挂载的目录节点id
	 */
	@Column(length = 32, nullable = false)
	private String bookContentId = "";

	/**
	 * 挂载的目录节点名
	 */
	@Column(length = 255, nullable = false)
	private String bookContentName = "";

	/**
	 * 挂载的父节点id,逗号隔开，多个父节点
	 */
	@Column(length = 255, nullable = false)
	private String bookContentPid = "";

	/**
	 * 挂载的父节点名称。
	 */
	@Column(length = 1024, nullable = false)
	private String bookContentPname = "";

	/**
	 * 资源封面
	 */
	private String cover;

	@Column(length = 32, nullable = false)
	private String bookId = "";

	@Column(length = 32, nullable = false)
	private String typeId;

	@Column(length = 255, nullable = false)
	private String typeName;

	@Column(length = 32, nullable = false)
	private String formatId;

	@Column(length = 255, nullable = false)
	private String formatName;

	/** 审核不通过备注 */
	@Column(length = 255)
	private String remark;

	/** 视频文件时长 */
	@Column(name = "duration")
	private Integer duration = 0;

	// 视频转换次数
	@Column(name = "convert_retry_times")
	private Integer convertRetryTimes = 0;

	// 区域精品 0 否 1是
	@Column(name = "is_high_quality_qy")
	private Integer isHighQualityQy = 0;

	// 云校精品 0否 1是
	@Column(name = "is_high_quality_yx")
	private Integer isHighQualityYx = 0;

	@Column(name = "is_vip")
	private Boolean isVip = false;

	/**
	 * 资源等级: 0-不标记,1-合格,2-良好,3-优秀
	 */
	@Column(columnDefinition = "int default 0 comment '0-不标记,1-合格,2-良好,3-优秀' ")
	private Integer ranks = 0;

	public Boolean getIsVip() {
		return isVip;
	}

	public void setIsVip(Boolean isVip) {
		this.isVip = isVip;
	}

	public Integer getConvertRetryTimes() {
		return convertRetryTimes;
	}

	public void setConvertRetryTimes(Integer convertRetryTimes) {
		this.convertRetryTimes = convertRetryTimes;
	}

	public String getShoolId() {
		return shoolId;
	}

	public void setShoolId(String shoolId) {
		this.shoolId = shoolId;
	}

	public String getSchoolName() {
		return schoolName;
	}

	public void setSchoolName(String schoolName) {
		this.schoolName = schoolName;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public String getUploaderId() {
		return uploaderId;
	}

	public void setUploaderId(String uploaderId) {
		this.uploaderId = uploaderId;
	}

	public String getUploaderName() {
		return uploaderName;
	}

	public void setUploaderName(String uploaderName) {
		this.uploaderName = uploaderName;
	}

	public String getUploaderSchoolId() {
		return uploaderSchoolId;
	}

	public void setUploaderSchoolId(String uploaderSchoolId) {
		this.uploaderSchoolId = uploaderSchoolId;
	}

	public String getUploaderSchoolName() {
		return uploaderSchoolName;
	}

	public void setUploaderSchoolName(String uploaderSchoolName) {
		this.uploaderSchoolName = uploaderSchoolName;
	}

	public String getIntro() {
		return intro;
	}

	public void setIntro(String intro) {
		this.intro = intro;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Integer getFileSize() {
		return fileSize;
	}

	public void setFileSize(Integer fileSize) {
		this.fileSize = fileSize;
	}

	public String getExtension() {
		return extension;
	}

	public void setExtension(String extension) {
		this.extension = extension;
	}

	public String getMd5() {
		return md5;
	}

	public void setMd5(String md5) {
		this.md5 = md5;
	}

	public Long getDownloadCount() {
		return downloadCount;
	}

	public void setDownloadCount(Long downloadCount) {
		this.downloadCount = downloadCount;
	}

	public Long getPv() {
		return pv;
	}

	public void setPv(Long pv) {
		this.pv = pv;
	}

	public Long getFavoriteCount() {
		return favoriteCount;
	}

	public void setFavoriteCount(Long favoriteCount) {
		this.favoriteCount = favoriteCount;
	}

	public Integer getIsDelete() {
		return isDelete;
	}

	public void setIsDelete(Integer isDelete) {
		this.isDelete = isDelete;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Integer getConvertStatus() {
		return convertStatus;
	}

	public void setConvertStatus(Integer convertStatus) {
		this.convertStatus = convertStatus;
	}

	public String getAuditUserId() {
		return auditUserId;
	}

	public void setAuditUserId(String auditUserId) {
		this.auditUserId = auditUserId;
	}

	public String getAuditUserName() {
		return auditUserName;
	}

	public void setAuditUserName(String auditUserName) {
		this.auditUserName = auditUserName;
	}

	public String getAuditSchoolId() {
		return auditSchoolId;
	}

	public void setAuditSchoolId(String auditSchoolId) {
		this.auditSchoolId = auditSchoolId;
	}

	public String getAuditSchoolName() {
		return auditSchoolName;
	}

	public void setAuditSchoolName(String auditSchoolName) {
		this.auditSchoolName = auditSchoolName;
	}

	public Integer getViewScope() {
		return viewScope;
	}

	public void setViewScope(Integer viewScope) {
		this.viewScope = viewScope;
	}

	public Integer getIsYxView() {
		return isYxView;
	}

	public void setIsYxView(Integer isYxView) {
		this.isYxView = isYxView;
	}

	public String getLocation() {
		return location;
	}

	public void setLocation(String location) {
		this.location = location;
	}

	public Integer getIsYxYunRes() {
		return isYxYunRes;
	}

	public void setIsYxYunRes(Integer isYxYunRes) {
		this.isYxYunRes = isYxYunRes;
	}

	public String getProvinceCode() {
		return provinceCode;
	}

	public void setProvinceCode(String provinceCode) {
		this.provinceCode = provinceCode;
	}

	public String getCityCode() {
		return cityCode;
	}

	public void setCityCode(String cityCode) {
		this.cityCode = cityCode;
	}

	public String getDistrictCode() {
		return districtCode;
	}

	public void setDistrictCode(String districtCode) {
		this.districtCode = districtCode;
	}

	public float getMark() {
		return mark;
	}

	public void setMark(float mark) {
		this.mark = mark;
	}

	public Date getUploadTime() {
		return uploadTime;
	}

	public void setUploadTime(Date uploadTime) {
		this.uploadTime = uploadTime;
	}

	public String getSubjectId() {
		return subjectId;
	}

	public void setSubjectId(String subjectId) {
		this.subjectId = subjectId;
	}

	public String getSubjectName() {
		return subjectName;
	}

	public void setSubjectName(String subjectName) {
		this.subjectName = subjectName;
	}

	public String getVersionId() {
		return versionId;
	}

	public void setVersionId(String versionId) {
		this.versionId = versionId;
	}

	public String getVersionName() {
		return versionName;
	}

	public void setVersionName(String versionName) {
		this.versionName = versionName;
	}

	public String getPhaseId() {
		return phaseId;
	}

	public void setPhaseId(String phaseId) {
		this.phaseId = phaseId;
	}

	public String getPhaseName() {
		return phaseName;
	}

	public void setPhaseName(String phaseName) {
		this.phaseName = phaseName;
	}

	public String getSemesterId() {
		return semesterId;
	}

	public void setSemesterId(String semesterId) {
		this.semesterId = semesterId;
	}

	public String getSemesterName() {
		return semesterName;
	}

	public void setSemesterName(String semesterName) {
		this.semesterName = semesterName;
	}

	public String getBookContentId() {
		return bookContentId;
	}

	public void setBookContentId(String bookContentId) {
		this.bookContentId = bookContentId;
	}

	public String getBookContentName() {
		return bookContentName;
	}

	public void setBookContentName(String bookContentName) {
		this.bookContentName = bookContentName;
	}

	public String getBookContentPid() {
		return bookContentPid;
	}

	public void setBookContentPid(String bookContentPid) {
		this.bookContentPid = bookContentPid;
	}

	public String getBookContentPname() {
		return bookContentPname;
	}

	public void setBookContentPname(String bookContentPname) {
		this.bookContentPname = bookContentPname;
	}

	public String getBookId() {
		return bookId;
	}

	public void setBookId(String bookId) {
		this.bookId = bookId;
	}

	public String getTypeId() {
		return typeId;
	}

	public void setTypeId(String typeId) {
		this.typeId = typeId;
	}

	public String getTypeName() {
		return typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	public String getFormatId() {
		return formatId;
	}

	public void setFormatId(String formatId) {
		this.formatId = formatId;
	}

	public String getFormatName() {
		return formatName;
	}

	public void setFormatName(String formatName) {
		this.formatName = formatName;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getCover() {
		return cover;
	}

	public void setCover(String cover) {
		this.cover = cover;
	}

	public Integer getDuration() {
		return duration;
	}

	public void setDuration(Integer duration) {
		this.duration = duration;
	}

	@Override
	public String toString() {
		return "YxyResResource [shoolId=" + shoolId + ", schoolName=" + schoolName + ", author=" + author
				+ ", uploaderId=" + uploaderId + ", uploaderName=" + uploaderName + ", uploaderSchoolId="
				+ uploaderSchoolId + ", uploaderSchoolName=" + uploaderSchoolName + ", intro=" + intro + ", title="
				+ title + ", fileSize=" + fileSize + ", extension=" + extension + ", md5=" + md5 + ", downloadCount="
				+ downloadCount + ", pv=" + pv + ", favoriteCount=" + favoriteCount + ", isDelete=" + isDelete
				+ ", status=" + status + ", convertStatus=" + convertStatus + ", auditUserId=" + auditUserId
				+ ", auditUserName=" + auditUserName + ", auditSchoolId=" + auditSchoolId + ", auditSchoolName="
				+ auditSchoolName + ", viewScope=" + viewScope + ", isYxView=" + isYxView + ", location=" + location
				+ ", isYxYunRes=" + isYxYunRes + ", provinceCode=" + provinceCode + ", cityCode=" + cityCode
				+ ", districtCode=" + districtCode + ", mark=" + mark + ", uploadTime=" + uploadTime + ", subjectId="
				+ subjectId + ", subjectName=" + subjectName + ", versionId=" + versionId + ", versionName="
				+ versionName + ", phaseId=" + phaseId + ", phaseName=" + phaseName + ", semesterId=" + semesterId
				+ ", semesterName=" + semesterName + ", bookContentId=" + bookContentId + ", bookContentName="
				+ bookContentName + ", bookContentPid=" + bookContentPid + ", bookContentPname=" + bookContentPname
				+ ", cover=" + cover + ", bookId=" + bookId + ", typeId=" + typeId + ", typeName=" + typeName
				+ ", formatId=" + formatId + ", formatName=" + formatName + ", remark=" + remark + ", duration="
				+ duration + "]";
	}

	public Integer getIsHighQualityQy() {
		return isHighQualityQy;
	}

	public void setIsHighQualityQy(Integer isHighQualityQy) {
		this.isHighQualityQy = isHighQualityQy;
	}

	public Integer getIsHighQualityYx() {
		return isHighQualityYx;
	}

	public void setIsHighQualityYx(Integer isHighQualityYx) {
		this.isHighQualityYx = isHighQualityYx;
	}

}
